package com.CampusLife.service.impl;


import  com.CampusLife.bean.Product;
import  com.CampusLife.dao.IProductDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import  com.CampusLife.service.IProductService;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class ProductServiceImpl implements IProductService {
    @Resource
    private IProductDao iProductDao;

    @Override
    public List<Product> queryAll() {
        return iProductDao.queryAll();
    }

    @Override
    public Product queryById(Integer pid) {
        return iProductDao.queryById(pid);
    }

    @Override
    public void add(Product product) {
        iProductDao.add(product);
    }

    @Override
    public void update(Product product) {

        iProductDao.update(product);
    }

    @Override
    public void delete(Integer pid) {
        iProductDao.delete(pid);
    }

    @Override
    public Product getProduct(Product pid) {
       Product product=iProductDao.getProduct(pid);
        return product;
    }

    @Override
    public List<Product> getProductAllShen() {
        List<Product> products=  iProductDao.getProductAllShen();
        return products;
    }

    @Override
    public List<Product>   getProductAll() {
     List<Product> product = iProductDao.getProductAll();
        return product;
    }

    @Override
    public List<Product> getProductByname(Product pid) {
        List<Product> lostProducts=iProductDao.getProductByname(pid);
        return lostProducts;
    }

    @Override
    public List<Product> getProductByType(int t_id) {
        List<Product> lostProducts=iProductDao.getProductByType(t_id);
        return lostProducts;
    }

    @Override
    public List<Product> getProductAllByName(Product product) {

        List<Product> lostProducts=iProductDao.getProductAllByName(product);
        return lostProducts;
    }

    @Override
    public List<Product> getProductByType0(int t_id) {
        List<Product> lostProducts=iProductDao.getProductByType0(t_id);
        return lostProducts;
    }

    @Override
    public List<Product> getProductAllByName0(Product product) {
        List<Product> lostProducts=iProductDao.getProductAllByName0(product);
        return lostProducts;
    }

    @Override
    public List<Product> getOrder() {
        return iProductDao.getOrder();
    }

    @Override
    public List<Product> getProductByBook() {
        List<Product> lostProducts=iProductDao.getProductByBook();
        return lostProducts;
    }


    @Override
    public  void updateStatus(int pid) {

        iProductDao.updateStatus(pid);

    }

    @Override
    public Product getProductById(int pid) {
        Product product=iProductDao.getProductById(pid);
        return product;
    }

    @Override
    public List<Product> getProductByPhone() {
        List<Product> lostProducts=iProductDao.getProductByPhone();
        return lostProducts;
    }

    @Override
    public List<Product> getProductByComputer() {
        List<Product> lostProducts=iProductDao.getProductByComputer();
        return lostProducts;
    }

    @Override
    public List<Product> getProductByVehicle() {
        List<Product> lostProducts=iProductDao.getProductByVehicle();
        return lostProducts;
    }

    @Override
    public List<Product> getProductByEquipment() {
        List<Product> lostProducts=iProductDao.getProductByEquipment();
        return lostProducts;
    }
    @Override
    public List<Product> getProductByElectric() {
        List<Product> lostProducts=iProductDao.getProductByElectric();
        return lostProducts;
    }

    @Override
    public List<Product> getProductByLife() {
        return iProductDao.getProductByLife();
    }

    @Override
    public List<Product> queryByName(String p_name) {
        return iProductDao.queryByName(p_name);
    }

    @Override
    public List<Product> getProductByUserId(Integer id) {
        return iProductDao.getProductByUserId(id);
    }


}
